--DelteArchiveUI.lua
require 'fairygui.Window'

DelteArchiveUI = class(Window)
local prop = property(DelteArchiveUI)
prop:accessor("child_id", 0)

function DelteArchiveUI:__init()
    self:loadLayout("DelteArchiveUI", "Main")
end

function DelteArchiveUI:initEvent()
    self:addClick("Confirm", function()
        -- 删除存档
        g_event_mgr:notifyListener("onDelArchive", self.child_id)
        self:close()
    end)
    self:getChild("Cancel").onClick:Add(function()
        self:close()
    end)
end

function DelteArchiveUI:SetInfo(id, name)
    self.child_id = id
    local message = self:getChild("message")
    message:SetVar("name", name)
    message:FlushVars()
end